package com.atguigu.day11.ploy.p3;


public class InstanceofTest {
    public static void main(String[] args) {
        Dog d = new Dog();
        System.out.println("d instanceof Dog = " + (d instanceof Dog));
        System.out.println("d instanceof Animal = " + (d instanceof Animal));
        System.out.println("d instanceof Object = " + (d instanceof Object));
        System.out.println("---------------------");
        Animal a = new Cat();
        System.out.println("a instanceof Cat = " + (a instanceof Cat));
        System.out.println("a instanceof Animal = " + (a instanceof Animal));
        System.out.println("a instanceof Dog = " + (a instanceof Dog));//false

    }
}
